/**
 * @version 1.0.0
 * @Title: MidiFileWriter
 * @Package: lx.music.sound.midi.spi
 * @Description: Copyright: Copyright (c) 2016
 * @Company: 成都壹柒互动科技有限公司
 * @author huangzhilong.hzl
 * @date 2017-11-02 13:20
 */
package lx.music.sound.midi.spi;

import lx.music.sound.midi.Sequence;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

/**
 * @version 1.0.0
 * @Title: MidiFileWriter
 * @Package: lx.music.sound.midi.spi
 * @Description: Copyright: Copyright (c) 2016
 * @Company: 成都壹柒互动科技有限公司
 * @author huangzhilong.hzl
 * @date 2017-11-02 13:20
 */
public abstract class MidiFileWriter {

    public abstract int[] getMidiFileTypes() ;

    public abstract int[] getMidiFIleTypes(Sequence sequence) ;

    public boolean isFileTypeSupported(int fileType){
        int types[] = getMidiFileTypes() ;
        for(int i=0 ; i<types.length;i++){
            if(fileType==types[i]){
                return true ;
            }
        }
        return false ;
    }


    public abstract int write(Sequence in, int fileType, OutputStream out) throws IOException ;

    public abstract int write(Sequence in, int fileType, File out)throws IOException;

}
